<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Get extends CI_Controller {

	public function data($year=0,$month=0,$tourId=0,$userId=0,$rand=0)
	{
		if($year==0||$month==0||$tourId==0||$userId==0)
		{
			echo "'No all data in GET.php->data' line 7";
			$this->log('No all data in GET.php->data');
			die();
		}
		$otkuda=getenv("HTTP_REFERER");
		//$this->log("otkuda ".$otkuda);
		$www = strstr($otkuda,"ref=");
		//$this->log($www);
		$site=explode('/',$www);
		if(count($site)<2)
		{
			$site[2]='';
		}
		
		$year=(int)$year;
		$month=(int)$month;
		$tourId=(int)$tourId;
		$this->load->model('flash');
		$result=$this->flash->create_xml($year,$month,$tourId,$userId,$site[2]);
			$this->load->view('responce',$result);

		//print_r($result);
	}
	public function month($year=0,$month=0,$rand=0)
	{
		if($year==0||$month==0)
		{
			$this->log('No all data in GET.php->month line 42');
			die();
		}
		$year=(int)$year;
		$month=(int)$month;
		$this->load->model('flash');
		$result=$this->flash->month($year,$month);
		$this->load->view('month',$result);

	}
	function id($idCountry=0,$type=0)
	{
		if($idCountry==0||$type==0)
		{
			$this->log('No all data in GET.php->month line 42');
			die();
		}
		
		$this->load->model('flash');
		$result=$this->flash->id($idCountry,$type);
		$this->load->view('id',$result);
	}
	function knowing($year=0,$month=0,$id=0,$userId=0,$rand=0)
	{
		$otkuda=getenv("HTTP_REFERER");
		//$this->log("otkuda ".$otkuda);
		$www = strstr($otkuda,"ref=");
		//$this->log($www);
		$site=explode('/',$www);
		
		if(count($site)<2)
		{
			$site[2]='';
		}
		//$this->log($site[2]);
		if($year==0||$month==0||$id==0)
		{
			$this->log('No all data in GET.php->data line 69');
			die();
		}
		$year=(int)$year;
		$month=(int)$month;
		$id=(int)$id;
		$this->load->model('flash');
		$result=$this->flash->create_knowing($year,$month,$id,$userId,$site[2]);
		$this->load->view('knowing',$result);
	}
}